<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja" id="main">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Graphics 类</title>
	<link rel="stylesheet" href="../inc/css/style.min.css" />
	<script type="text/javascript" src="../inc/js/lib/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="../inc/js/common.js"></script>
</head>
<body>

	<div class="main">

		<h1 class="main__title--h1 main__title--h1--v07">Graphics 类</h1>
		<ul class="breadcrumb">
			<li>JS 库</li>
			<li>&gt;</li>
			<li>Graphics 类</li>
		</ul>
		<p>负责画面处理的静态类。</p>

		<div class="main__section">
			<h2 class="main__title--h2">索引</h2>
			<b>方法</b>
			<ul class="main__ul--inline">
				<li><a href="#m01">canPlayVideoType</a> <span>static</span></li>
				<li><a href="#m02">canUseDifferenceBlend</a> <span>static</span></li>
				<li><a href="#m03">canUseSaturationBlend</a> <span>static</span></li>
				<li><a href="#m04">endLoading</a> <span>static</span></li>
				<li><a href="#m05">hasWebGL</a> <span>static</span></li>
				<li><a href="#m06">hideFps</a> <span>static</span></li>
				<li><a href="#m07">initialize</a> <span>static</span></li>
				<li><a href="#m08">isFontLoaded</a> <span>static</span></li>
				<li><a href="#m09">isInsideCanvas</a> <span>static</span></li>
				<li><a href="#m10">isVideoPlaying</a> <span>static</span></li>
				<li><a href="#m11">isWebGL</a> <span>static</span></li>
				<li><a href="#m12">loadFont</a> <span>static</span></li>
				<li><a href="#m13">pageToCanvasX</a> <span>static</span></li>
				<li><a href="#m14">pageToCanvasY</a> <span>static</span></li>
				<li><a href="#m15">playVideo</a> <span>static</span></li>
				<li><a href="#m16">printError</a> <span>static</span></li>
				<li><a href="#m17">render</a> <span>static</span></li>
				<li><a href="#m18">setLoadingImage</a> <span>static</span></li>
				<li><a href="#m19">showFps</a> <span>static</span></li>
				<li><a href="#m20">startLoading</a> <span>static</span></li>
				<li><a href="#m21">tickEnd</a> <span>static</span></li>
				<li><a href="#m22">tickStart</a> <span>static</span></li>
				<li><a href="#m23">updateLoading</a> <span>static</span></li>
			</ul>

			<b>属性</b>
			<ul class="main__ul--inline">
				<li><a href="#p01">BLEND_ADD</a> <span>static</span></li>
				<li><a href="#p02">BLEND_MULTIPLY</a> <span>static</span></li>
				<li><a href="#p03">BLEND_NORMAL</a> <span>static</span></li>
				<li><a href="#p04">BLEND_SCREEN</a> <span>static</span></li>
				<li><a href="#p05">boxHeight</a> <span>static</span></li>
				<li><a href="#p06">boxWidth</a> <span>static</span></li>
				<li><a href="#p07">frameCount</a> <span>static</span></li>
				<li><a href="#p08">height</a> <span>static</span></li>
				<li><a href="#p09">scale</a> <span>static</span></li>
				<li><a href="#p10">width</a> <span>static</span></li>
			</ul>
		</div><!-- /main__section -->


		<div class="main__section">
			<h2 class="main__title--h2">方法</h2>

			<div id="m01" class="main__subsection">
<pre class="main__pre--code">
canPlayVideoType ( type ) <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测浏览器能否播放指定格式的视频。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">type</code>
							<span class="type">String</span>
							<div class="param-description">
								<p>待检测的视频格式</p>
							</div>
						</li>
					</ul>
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span> <br />
					若浏览器可以播放该格式视频，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m02" class="main__subsection">
<pre class="main__pre--code">
canUseDifferenceBlend () <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测 canvas 是否支持差值混合模式。</p>
				<div class="params">
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span><br />
					若支持该混合模式，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m03" class="main__subsection">
<pre class="main__pre--code">
canUseSaturationBlend () <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测 canvas 是否支持饱和度混合模式。</p>
				<div class="params">
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span><br />
					若支持该混合模式，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m04" class="main__subsection">
<pre class="main__pre--code">
endLoading () <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">清除“正在读取中”状态的图片。</p>
			</div><!-- /div -->

			<div id="m05" class="main__subsection">
<pre class="main__pre--code">
hasWebGL () <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测浏览器是否支持 WebGL。</p>
				<div class="params">
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span><br />
					若浏览器支持 WebGL，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m06" class="main__subsection">
<pre class="main__pre--code">
hideFps () <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">隐藏 FPS 显示。</p>
			</div><!-- /div -->

			<div id="m07" class="main__subsection">
<pre class="main__pre--code">
initialize ( width , height , type ) <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">初始化画面系统。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">width</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>游戏画面的宽度</p>
							</div>
						</li>
						<li class="param">
							<code class="param-name">height</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>游戏画面的高度</p>
							</div>
						</li>
						<li class="param">
							<code class="param-name">type</code>
							<span class="type">String</span>
							<div class="param-description">
								<p>渲染器的类型（'canvas'、'webgl' 或 'auto'）</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m08" class="main__subsection">
<pre class="main__pre--code">
isFontLoaded ( name ) <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测字体文件是否载入。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">name</code>
							<span class="type">String</span>
							<div class="param-description">
								<p>字体的文件名</p>
							</div>
						</li>
					</ul>
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span><br />
					若成功载入，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m09" class="main__subsection">
<pre class="main__pre--code">
isInsideCanvas ( x , y ) <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测指定点是否在游戏的 canvas 区域内。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">x</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>指定点的 X 坐标</p>
							</div>
						</li>
						<li class="param">
							<code class="param-name">y</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>指定点的 Y 坐标</p>
							</div>
						</li>
					</ul>
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span><br />
					若指定点在 canvas 内，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m10" class="main__subsection">
<pre class="main__pre--code">
isVideoPlaying () <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测是否正在播放视频。</p>
				<div class="params">
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span><br />
					若正在播放视频，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m11" class="main__subsection">
<pre class="main__pre--code">
isWebGL () <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">检测渲染器的类型是否为 WebGL 。</p>
				<div class="params">
					<h4>返回值：</h4>
					<p><span class="pre__type">Boolean:</span><br />
					若渲染器类型为WebGL，返回 true </p>
				</div>
			</div><!-- /div -->

			<div id="m12" class="main__subsection">
<pre class="main__pre--code">
loadFont ( name , url ) <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">读取字体文件。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">name</code>
							<span class="type">String</span>
							<div class="param-description">
								<p>字体文件的文件名</p>
							</div>
						</li>
						<li class="param">
							<code class="param-name">url</code>
							<span class="type">String</span>
							<div class="param-description">
								<p>字体文件的地址</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m13" class="main__subsection">
<pre class="main__pre--code">
pageToCanvasX ( x ) <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">将页面的 X 坐标转换为 canvas 中与之对应的 X 坐标。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">x</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>页面的 X 坐标</p>
							</div>
						</li>
					</ul>
					<h4>返回值：</h4>
					<p><span class="pre__type">Number:</span><br />
					canvas 中与之对应的 X 坐标</p>
				</div>
			</div><!-- /div -->

			<div id="m14" class="main__subsection">
<pre class="main__pre--code">
pageToCanvasY ( y ) <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">将页面的 Y 坐标转换为 canvas 中与之对应的 Y 坐标。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">y</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>页面的 Y 坐标</p>
							</div>
						</li>
					</ul>
					<h4>返回值：</h4>
					<p><span class="pre__type">Number:</span><br />
					canvas 中与之对应的 Y 坐标</p>
				</div>
			</div><!-- /div -->

			<div id="m15" class="main__subsection">
<pre class="main__pre--code">
playVideo ( src ) <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">开始播放视频。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">src</code>
							<span class="type">String</span>
							<div class="param-description 呵呵">
								<p>视频文件的地址</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m16" class="main__subsection">
<pre class="main__pre--code">
printError ( name , message ) <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">在屏幕上显示错误信息。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">name</code>
							<span class="type">String</span>
							<div class="param-description">
								<p>错误信息的标题</p>
							</div>
						</li>
						<li class="param">
							<code class="param-name">message</code>
							<span class="type">String</span>
							<div class="param-description">
								<p>错误信息的内容</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m17" class="main__subsection">
<pre class="main__pre--code">
render ( stage ) <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">在屏幕上渲染指定的 stage（场景） 。</p>
				<div class="params">
					<h4>参数：</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">stage</code>
							<span class="type">Stage</span>
							<div class="param-description">
								<p>需要渲染的 stage（场景） 对象</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m18" class="main__subsection">
<pre class="main__pre--code">
setLoadingImage () <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">设置“正在读取中”状态的图片。</p>
			</div><!-- /div -->

			<div id="m19" class="main__subsection">
<pre class="main__pre--code">
showFps () <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">显示 FPS 。</p>
			</div><!-- /div -->

			<div id="m20" class="main__subsection">
<pre class="main__pre--code">
startLoading () <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">初始化“正在读取中”状态的计时器。</p>
			</div><!-- /div -->

			<div id="m21" class="main__subsection">
<pre class="main__pre--code">
tickEnd () <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">帧结束的标志（用于计算 FPS ）。</p>
			</div><!-- /div -->

			<div id="m22" class="main__subsection">
<pre class="main__pre--code">
tickStart () <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">帧开始的标志（用于计算 FPS ）。</p>
			</div><!-- /div -->

			<div id="m23" class="main__subsection">
<pre class="main__pre--code">
updateLoading () <span class="pre__type"></span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">累加“正在读取中”状态的计时器时间，必要时，显示“正在读取中”状态设置的图片。</p>
			</div><!-- /div -->

		</div><!-- /main__section -->


		<div class="main__section">
			<h2 class="main__title--h2">属性</h2>

			<div id="p01" class="main__subsection">
<pre class="main__pre--code">
BLEND_ADD <span class="pre__type">Number</span> <span class="pre__static">[final]</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px"> PIXI.blendModes.ADD 函数的别名。</p>
			</div><!-- /div -->

			<div id="p02" class="main__subsection">
<pre class="main__pre--code">
BLEND_MULTIPLY <span class="pre__type">Number</span> <span class="pre__static">[final]</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px"> PIXI.blendModes.MULTIPLY 函数的别名。</p>
			</div><!-- /div -->

			<div id="p03" class="main__subsection">
<pre class="main__pre--code">
BLEND_NORMAL <span class="pre__type">Number</span> <span class="pre__static">[final]</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px"> PIXI.blendModes.NORMAL 函数的别名。</p>
			</div><!-- /div -->

			<div id="p04" class="main__subsection">
<pre class="main__pre--code">
BLEND_SCREEN <span class="pre__type">Number</span> <span class="pre__static">[final]</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px"> PIXI.blendModes.SCREEN 函数的别名。</p>
			</div><!-- /div -->

			<div id="p05" class="main__subsection">
<pre class="main__pre--code">
boxHeight <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">窗口显示区域的高度。</p>
			</div><!-- /div -->

			<div id="p06" class="main__subsection">
<pre class="main__pre--code">
boxWidth <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">窗口显示区域的宽度。</p>
			</div><!-- /div -->

			<div id="p07" class="main__subsection">
<pre class="main__pre--code">
frameCount <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">游戏运行经过的总帧数。</p>
			</div><!-- /div -->

			<div id="p08" class="main__subsection">
<pre class="main__pre--code">
height <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">游戏画面的高度。</p>
			</div><!-- /div -->

			<div id="p09" class="main__subsection">
<pre class="main__pre--code">
scale <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">游戏画面的缩放倍率。</p>
			</div><!-- /div -->

			<div id="p10" class="main__subsection">
<pre class="main__pre--code">
width <span class="pre__type">Number</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">游戏画面的宽度。</p>
			</div><!-- /div -->

		</div>


	</div><!-- /main -->

</body>
</html>